import request from '../utils/request';
//仓库管理业务接口文档
const api = {
  // 分页获取采购单数据列表
  GetMatchPagePurchaseOrders(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/GetMatchPagePurchaseOrders',
      method: 'post',
      data,
    });
  },
  // 获取采购单详情数据
  GetSinglePurchaseOrder(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/GetSinglePurchaseOrder',
      method: 'post',
      data,
    });
  },
  // 获取采购类型数据
  GetAllPurchaseType(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/GetAllPurchaseType',
      method: 'post',
      data,
    });
  },
  // 新增采购单
  AddPurchaseOrder(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/AddPurchaseOrder',
      method: 'post',
      data,
    });
  },
  // 修改采购单
  UpdatePurchaseOrder(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/UpdatePurchaseOrder',
      method: 'post',
      data,
    });
  },
  // 删除采购单（待确认状态才能执行删除）
  DeletePurchaseOrder(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/DeletePurchaseOrder',
      method: 'post',
      data,
    });
  },
  // 确认采购单
  SurePurchaseOrder(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/SurePurchaseOrder',
      method: 'post',
      data,
    });
  },
  // 采购单到货确认
  ConfirmGoodsPurchaseOrder(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/ConfirmGoodsPurchaseOrder',
      method: 'post',
      data,
    });
  },
  // 删除采购明细
  DeletePurchaseDetail(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/DeletePurchaseDetail',
      method: 'post',
      data,
    });
  },
  // 作废采购单
  VoidPurchaseOrder(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/VoidPurchaseOrder',
      method: 'post',
      data,
    });
  },
  // 分页获取匹配的采购明细
  GetMatchPagePurchaseOrderDetails(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/GetMatchPagePurchaseOrderDetails',
      method: 'post',
      data,
    });
  },
  // 更新采购明细对账状态
  UpdatePurchaseOrderDetailReconciled(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/UpdatePurchaseOrderDetailReconciled',
      method: 'post',
      data,
      isRepeat: true, //允许重复
    });
  },
  // 更新采购明细对账修正数量
  UpdatePurchaseOrderDetailReconciledQuantity(data?: any) {
    return request({
      url: '/api/GoodsPurchaseOrder/UpdatePurchaseOrderDetailReconciledQuantity',
      method: 'post',
      data,
    });
  },
};
export default api;
